package com.snow.useviewdemo.function.eventtouch

import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import android.view.View
import com.snow.useviewdemo.R
import com.snow.useviewdemo.base.BaseKotlinActivity
import kotlinx.android.synthetic.main.activity_event_delivery.*

/**
 * Created by zhaoyingtao
 * Date: 2021/9/9
 * Describe:
 */
class EventDeliveryActivity : BaseKotlinActivity() {
    override fun getLayoutId(): Int {
        return R.layout.activity_event_delivery
    }

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        Log.e("eventSnow", "===EventDeliveryActivity==dispatchTouchEvent=====${ev?.action}")
        return super.dispatchTouchEvent(ev)
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        Log.e("eventSnow", "===EventDeliveryActivity==onTouchEvent=====${event?.action}")
        return super.onTouchEvent(event)
    }

    override fun setViewData(savedInstanceState: Bundle?) {
        buttonAlert.setOnClickListener {
            if (textViewAlert.visibility == View.VISIBLE) {
                AlertAnimUtils.hideAlertView(textViewAlert)
            } else {
                AlertAnimUtils.showAlertView(textViewAlert)
            }
        }
    }
}